package com.parse.starter;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity implements OnClickListener {

   private Button students, teachers, staff;
   
   @Override
   protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      students = (Button) findViewById(R.id.studentButton);
      teachers = (Button) findViewById(R.id.teacherButton);
      staff = (Button) findViewById(R.id.staffButton);
      students.setOnClickListener(this);
      teachers.setOnClickListener(this);
      staff.setOnClickListener(this);
   }

   @Override
   public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
   }

   public void onClick(View view) {
	   
	   Intent msg = new Intent(this, ListDisplayActivity.class);
	   
      switch(view.getId()) {
         case R.id.studentButton:
        	 msg.putExtra("sortby", "Student");
            break;
         case R.id.teacherButton:
            break;
         case R.id.staffButton:
            break;
      }
      this.startActivity(msg);
      
   }
}
